package com.example.demo.common.entity;

import java.io.Serializable;

/**
 * Created by Mojo on 2017/8/29.
 */
public class JsonResult implements Serializable {
	private static final long serialVersionUID = -113486665877014274L;

	private Integer ret;
	private String msg;
	private Object data;

	private Integer pageNum;
	private Integer pageSize;
	private Long total;

	public Integer getRet() {
		return ret;
	}

	public void setRet(Integer ret) {
		this.ret = ret;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public Integer getPageNum() {
		return pageNum;
	}

	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Long getTotal() {
		return total;
	}

	public void setTotal(Long total) {
		this.total = total;
	}

	public JsonResult(Object data, Integer pageNum, Integer pageSize, Long total) {
		this.ret = JsonResultStatus.RET_SUCCESS;
		this.msg = JsonResultStatus.MSG_SUCCESS;
		this.data = data;
		this.pageNum = pageNum;
		this.pageSize = pageSize;
		this.total = total;
	}

	public JsonResult(Integer ret, String msg, Object data) {
		this.ret = ret;
		this.msg = msg;
		this.data = data;
	}

	public JsonResult(Integer ret, String msg) {
		this.ret = ret;
		this.msg = msg;
	}

	public JsonResult() {
		this.ret = JsonResultStatus.RET_SUCCESS;
		this.msg = JsonResultStatus.MSG_SUCCESS;
	}
}
